package com.ciwong.mobilelib.i;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;

public abstract class BaseQuickOnItemClickListener extends VertifyDurationListener implements BaseQuickAdapter.OnItemClickListener {
    /**
     * 构造方法
     */
    public BaseQuickOnItemClickListener() {

    }

    /**
     * 构造方法
     *
     * @param duration 防止重点间隔时间
     */
    public BaseQuickOnItemClickListener(long duration) {
        this.duration = duration;
    }

    @Override
    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
        if (VertifyDuration()) {
            avertRepeatOnClick(adapter, view, position);
        }
    }

    /**
     * 防止重复点击时调用
     */
    public abstract void avertRepeatOnClick(BaseQuickAdapter adapter, View view, int position);
}
